package br.ufc.engsoft;

import android.app.Activity;
import android.os.Bundle;
import android.text.Html;
import android.util.Log;
import android.widget.TextView;
import br.ufc.engsoft.util.JSONFunctions;
import br.ufc.engsoft.util.Post;

public class GenericView extends Activity {
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.genericview);
		
		TextView text_title = (TextView)findViewById(R.id.title);
		TextView text_text = (TextView)findViewById(R.id.text);
		
		String passado = getIntent().getStringExtra("title");
		
		Log.i("titulo passado: ", passado);
		
		String url = JSONFunctions.setURLPost(passado);
		
		Post p = new Post(url);
		p.getPost();
		// Setando elementos na tela
		text_title.setText(Html.fromHtml(p.getTitle()));
		text_text.setText(Html.fromHtml(p.getText()));

		
	}

}
